package com.woniuxy.education.mapper;

import com.woniuxy.education.entity.Ncee;
import com.woniuxy.education.entity.Question_ask;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface QuestionAnswerMapper {


    /**
     *
     * 问题解答
     * @return
     */
   //查出提问，通过教师姓名
    @Select("SELECT * FROM question_ask WHERE tea_name=#{tname} and state=#{state} ")
    List<Question_ask> findQuestionAsk(@Param("tname") String tname,@Param("state")  String state);
    //回复提问
    @Update("update question_ask set answer=#{answer},recovery_time=now(),recovery_tea=#{recovery_tea},state=2 where id=#{id}")
    void insertQuestionAnswer(Question_ask question_ask);
    //查出指定提问，通过id
    @Select("SELECT * FROM question_ask WHERE id=#{id} ")
    Question_ask selectQuestionAsk(String id);


    /**
     *
     * 高考数据录入
     * @return
     */
    //添加高考数据
    @Insert("insert into ncee_info values(null,#{name},#{chinese},#{math},#{english},#{arts_synthesize},#{science_synthesize},#{total_score},#{university},#{professional},#{entry_score}) ")
    void insertNceeData(Ncee ncee);
}
